<?php
session_name(DicomScience);
session_start();
require('session.php');
require('html_head.php');
?>
<body onresize="resizeWindow()">
	<script type="text/javascript" src="reportView.js"></script>

<script>
	$(document).ready(function(){
		windowBase();
	});
	$.ui.dialog.defaults.bgiframe = true;
</script>
<?php
	if ($_GET['report'] != ""){
		echo "<script>";
		echo "\$(document).ready(function(){";
		echo "displayReport(".$_GET['report'].")";
		echo "});";	
		echo "</script>";		
	}
?>
<div id="mainMenu">
	<div id="login">
	<?php
	if($_SESSION['userid'] == 0){
		// GuestMode: No user logged in - show login window
		echo "<img id=\"loginButton\" class=\"hiddenMenuItem\" src=\"./themes/$thdir/but_arr_down.png\" alt=\"Login\"/>";
	} else {
		// Logged in - shów logout window
		echo "<img id=\"logoutButton\" class=\"hiddenMenuItem\" src=\"./themes/$thdir/but_x_it.png\" alt=\"Logout\" />";
	}
	?>
	</div>
	<div id="userName">
		<?php 
		$firstname = $_SESSION['firstname'];
		$lastname = $_SESSION['lastname'];
		echo $firstname." ".$lastname.$nls_welcome_to_dicomscience; 
		?>
	</div>
	<div id='menuLibrary'><?php echo $nls_library;?></div>
	<?php
		if ($_SESSION['userid'] != 0){
			echo "<div id='reportView'>$nls_myReports</div>";
		}
	?>
	<!--<div>eigene Fälle, wenn eingeloggt</div>
	<div>Quizmode</div>-->
</div>

<div id="loginWindow">
	<form id="loginForm" method="POST" action="login.php">
		<input type="text" class="loginField" id="loginUsername" name="loginUsername" value="<?php echo $nls_username; ?>"/>
		<input type="password" class="loginField" id="loginPassword" name="loginPassword" value="<?php echo $nls_password; ?>"/>
		<input type="checkbox" class="loginCheckbox" name="setCookie" value="true" /><?php echo "$nls_set_Cookie"; ?>
		<input type="submit" class="loginFieldButton" name="loginSubmit" id="loginSubmit" value="<?php echo $nls_login; ?>">
		<input type="button" class="loginFieldButton" name="loginAbort" id="loginAbort" value="<?php echo $nls_abort; ?>">
	</form>			
</div>
<div id="sidebar">
	<?php
	if ($_SESSION['userlevel'] > 2){
		echo "<div id='newReportFrame'><button id='newReport'>$nls_newReport</button></div>";
	}
	?>
	<div id="newReportEditor">
		<p class="newReportP"><?echo $nls_headline."  "; ?><input name="newHeadline" id="newHeadline" type="text" /></p>
		<p class="newReportP"><?echo $nls_diagnosis."  "; ?><input name="newDiagnosis" id="newDiagnosis" type="text" /></p>
		<input name="newReportSubmit" id="newReportSubmit" type="button" value="<?php echo $nls_newReport;?>" />
		<input name="newReportCancel" id="newReportCancel" type="button" value="<?php echo $nls_abort;?>" />
	</div>
<div id="myReportsReportList"></div>
</div>
	

	
<div id="myReportsContent">
</div>	

<div class="divDialog" id="editorId"><?php echo $_SESSION['userid'];?></div>
<div class="divDialog" id="reportText1"><?php echo $nls_reportStatus1;?></div>
<div class="divDialog" id="reportText2"><?php echo $nls_reportStatus5;?></div>
<div class="divDialog" id="reportText3"><?php echo $nls_headline;?></div>
<div class="divDialog" id="reportText4"><?php echo $nls_diagnosis;?></div>
<div class="divDialog" id="reportText5"><?php echo $nls_status;?></div>
<div class="divDialog" id="reportText6"><?php echo $nls_staticReportLink;?></div>
<div class="divDialog" id="reportText7"><?php echo $nls_mediaSavedChanges;?></div>
<div class="divDialog" id="reportText8"><?php echo $nls_myReportDelete;?></div>
<div class="divDialog" id="reportText9" title="<?php echo $nls_confirm; ?>">
	<?php echo $nls_confirmDeleteReport; ?>
</div>
<div class="divDialog" id="reportText10" title="<?php echo $nls_alert; ?>">
	<?php echo $nls_alertNewReportMissingData; ?>
</div>
<div class="divDialog" id="reportText11"><?php echo $nls_printPDF;?></div>